home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xmcd-1.4 / libdi.d / slioc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-10  |  4.0 KB  |  148 lines

  1. /*
  2.  *   libdi - CD Audio Player Device Interface Library
  3.  *
  4.  *   Copyright (C) 1995  Ti Kan
  5.  *   E-mail: ti@amb.org
  6.  *
  7.  *   This program is free software; you can redistribute it and/or modify
  8.  *   it under the terms of the GNU General Public License as published by
  9.  *   the Free Software Foundation; either version 2 of the License, or
  10.  *   (at your option) any later version.
  11.  *
  12.  *   This program is distributed in the hope that it will be useful,
  13.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *   GNU General Public License for more details.
  16.  *
  17.  *   You should have received a copy of the GNU General Public License
  18.  *   along with this program; if not, write to the Free Software
  19.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  *
  21.  */
  22. #ifndef __SLIOC_H__
  23. #define __SLIOC_H__
  24.  
  25. #if defined(DI_SLIOC) && !defined(DEMO_ONLY)
  26.  
  27. #ifndef LINT
  28. static char *_slioc_h_ident_ = "@(#)slioc.h    5.8 95/01/27";
  29. #endif
  30.  
  31. #ifdef linux
  32. #include <linux/cdrom.h>
  33. #ifndef CDROMLOAD
  34. #define CDROMLOAD    0x5310
  35. #endif
  36. #endif    /* linux */
  37.  
  38. #ifdef sun
  39. #ifdef SVR4
  40.  
  41. #include <sys/cdio.h>
  42.  
  43. #else
  44.  
  45. #include <sys/buf.h>
  46. #include <sun/dkio.h>
  47. #include <scsi/targets/srdef.h>
  48.  
  49. /* This is a hack to work around a bug in SunOS 4.x's _IO macro family
  50.  * in <sys/ioccom.h> which makes it incompatible with ANSI compilers.
  51.  * If Sun ever changes the definition of these then this will have
  52.  * to change...
  53.  */
  54. #undef _IO
  55. #undef _IOR
  56. #undef _IOW
  57. #undef _IOWR
  58. #undef CDROMPAUSE
  59. #undef CDROMRESUME
  60. #undef CDROMPLAYMSF
  61. #undef CDROMPLAYTRKIND
  62. #undef CDROMREADTOCHDR
  63. #undef CDROMREADTOCENTRY
  64. #undef CDROMSTOP
  65. #undef CDROMSTART
  66. #undef CDROMEJECT
  67. #undef CDROMVOLCTRL
  68. #undef CDROMSUBCHNL
  69.  
  70. #define _IO(x,y)    (_IOC_VOID | ((x) << 8) | (y))
  71. #define _IOR(x,y,t)    ( \
  72.                 _IOC_OUT | \
  73.                 ((sizeof(t) & _IOCPARM_MASK) << 16) | \
  74.                 ((x) << 8 ) | (y) \
  75.             )
  76. #define _IOW(x,y,t)    ( \
  77.                 _IOC_IN | \
  78.                 ((sizeof(t) & _IOCPARM_MASK) << 16) | \
  79.                 ((x) << 8) | (y) \
  80.             )
  81. #define _IOWR(x,y,t)    ( \
  82.                 _IOC_INOUT | \
  83.                 ((sizeof(t) & _IOCPARM_MASK) << 16) | \
  84.                 ((x) << 8) | (y) \
  85.             )
  86.  
  87. #define CDROMPAUSE        _IO('c', 10)
  88. #define CDROMRESUME        _IO('c', 11)
  89. #define CDROMPLAYMSF        _IOW('c', 12, struct cdrom_msf)
  90. #define CDROMPLAYTRKIND        _IOW('c', 13, struct cdrom_ti)
  91. #define CDROMREADTOCHDR        _IOR('c', 103, struct cdrom_tochdr)
  92. #define CDROMREADTOCENTRY    _IOWR('c', 104, struct cdrom_tocentry)
  93. #define CDROMSTOP        _IO('c', 105)
  94. #define CDROMSTART        _IO('c', 106)
  95. #define CDROMEJECT        _IO('c', 107)
  96. #define CDROMVOLCTRL        _IOW('c', 14, struct cdrom_volctrl)
  97. #define CDROMSUBCHNL        _IOWR('c', 108, struct cdrom_subchnl)
  98.  
  99. #endif    /* SVR4 */
  100. #endif    /* sun */
  101.  
  102.  
  103. /* Ioctl name lookup table structure */
  104. typedef struct {
  105.     int    cmd;
  106.     char    *name;
  107. } iocname_t;
  108.  
  109. /*
  110.  * Public functions
  111.  */
  112. extern void    slioc_init(curstat_t *, di_tbl_t *);
  113. extern bool_t    slioc_check_disc(curstat_t *);
  114. extern void    slioc_status_upd(curstat_t *);
  115. extern void    slioc_lock(curstat_t *, bool_t);
  116. extern void    slioc_repeat(curstat_t *, bool_t);
  117. extern void    slioc_shuffle(curstat_t *, bool_t);
  118. extern void    slioc_load_eject(curstat_t *);
  119. extern void    slioc_ab(curstat_t *);
  120. extern void    slioc_sample(curstat_t *);
  121. extern void    slioc_level(curstat_t *, byte_t, bool_t);
  122. extern void    slioc_play_pause(curstat_t *);
  123. extern void    slioc_stop(curstat_t *, bool_t);
  124. extern void    slioc_prevtrk(curstat_t *);
  125. extern void    slioc_nexttrk(curstat_t *);
  126. extern void    slioc_previdx(curstat_t *);
  127. extern void    slioc_nextidx(curstat_t *);
  128. extern void    slioc_rew(curstat_t *, bool_t);
  129. extern void    slioc_ff(curstat_t *, bool_t);
  130. extern void    slioc_warp(curstat_t *);
  131. extern void    slioc_route(curstat_t *);
  132. extern void    slioc_mute_on(curstat_t *);
  133. extern void    slioc_mute_off(curstat_t *);
  134. extern void    slioc_start(curstat_t *);
  135. extern void    slioc_icon(curstat_t *, bool_t);
  136. extern void    slioc_halt(curstat_t *);
  137. extern char    *slioc_mode(void);
  138. extern char    *slioc_vers(void);
  139.  
  140. #else    /* DI_SLIOC DEMO_ONLY */
  141.  
  142. #define slioc_init    NULL
  143.  
  144. #endif    /* DI_SLIOC DEMO_ONLY */
  145.  
  146. #endif    /* __SLIOC_H__ */
  147.  
  148.